package top.ed333.mcplugins.configurableevents.action;

import org.jetbrains.annotations.NotNull;

public class ActionManager {
    public static Action getActionByName(@NotNull String actionName, Object value) {
        Action result = null;
        switch (actionName) {
            case "cmd":
                result = new CmdAction(value);
                break;
            case "consoleCmd":
                result = new ConsoleCmdAction(value);
                break;
            case "message":
                result = new MessageAction(value);
                break;
            case "broadcast":
                result = new BroadCastAction(value);
                break;
            case "eco-take":
                result = new EcoTakeAction(Double.parseDouble(value.toString()));
                break;
            case "eco-give":
                result = new EcoGiveAction(Double.parseDouble(value.toString()));
                break;
            case "point-take":
                result = new PointsTakeAction(Integer.parseInt(value.toString()));
                break;
            case "point-give":
                result = new PointsGiveAction(Integer.parseInt(value.toString()));
                break;
        }

        return result;
    }
}
